<?php
	require_once 'mp3\Smarty.php';
	require_once 'mp3\Constants.php';
	require_once 'mp3\GestionarPlaylist.php';
	
	$smarty = new mp3_Smarty();
	
	if (array_key_exists('canco', $_GET)){
		$smarty->assign('pujada', 'ok');
	}

	session_start();
	
	require 'mp3/ComprovarSessio.php';
	
	echo $smarty->fetch('mp3\header.tpl');
	if (isset($_SESSION['userid'])){
		$playlists =Mp3_GestionarPlaylist::allPlaylists($_SESSION['userid']);
		$smarty->assign('playlists', $playlists);
	}
	echo $smarty->fetch('mp3\index.tpl');
	echo $smarty->fetch('mp3\footer.tpl');
?>